import { isUsername, isMobile, isEmail } from './validate'
export const checkUsername = (rule, value, callback) => {
  if (isUsername(value)) {
    callback()
  } else {
    callback('用户名由4-18位字母、数字、下划线组成（首位必须为字母）')
  }
}

export const checkMobile = (rule, value, callback) => {
  if (isMobile(value)) {
    callback()
  } else {
    callback('手机号码格式不正确')
  }
}

export const checkEmail = (rule, value, callback) => {
  if (isEmail(value)) {
    callback()
  } else {
    callback('电子邮箱格式不正确')
  }
}